{#    子页面要包含block中的内容，需要在引入block后，先添加 super()方法  #}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>
        {% block title %}
                PyBlog
        {% endblock %}
    </title>
    {#    除去title之外的head的内容  #}
    {% block head %}
        <link rel="shortcut icon" type="image/x-icon"
              href="{{ url_for('static',filename = 'icon/favicon.ico',_external = True) }}">
        <link rel="icon" type="image/x-icon" href="{{ url_for('static',filename='icon/favicon.ico',_external = True ) }}">

        {#        引入bootstarp相关内容  #}
        <link href="{{url_for('static',_external = True,filename = 'plugin/bootstrap/dist/css/bootstrap.min.css')}}" rel="stylesheet">
        {#        <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>     #}
        <script src="{{url_for('static',_external = True,filename = 'plugin/jquery-3.2.1.min.js')}}"></script>
        <script src="{{url_for('static',_external = True,filename = 'plugin/bootstrap/dist/js/bootstrap.min.js')}}"></script>
    {% endblock %}
</head>
<body>
{% block body_header %}
    <div class="navbar navbar-inverse" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="{{ url_for('main_view.index') }}">pyBlog</a>
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li><a href="{{ url_for('main_view.index') }}">Home</a></li>
                </ul>
                {#             判断是否有查看授权管理的权限 #}
                {% if current_user.can(1) %}
                    <ul class="nav navbar-nav">
                        <li><a href="{{ url_for('auth_view.list_role') }}">授权管理-(前台判断是否有权限)</a></li>
                    </ul>
                {% endif %}


                <ul class="nav navbar-nav">
                    <li><a href="{{ url_for('user_view.index') }}">用户列表-(使用装饰器后台判断是否有权限)</a></li>
                </ul>

                <ul class="nav navbar-nav navbar-right">

                    {% if current_user.is_authenticated %}
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">

                                Account <b class="caret"></b>
                            </a>
                            <ul class="dropdown-menu">
                                <li><a href="{{ url_for('auth_view.change_password') }}">修改密码</a></li>
                                <li><a href="{{ url_for('auth_view.logout') }}">登出</a></li>
                            </ul>
                        </li>
                    {% else %}
                        <li><a href="{{ url_for('auth_view.login') }}">登录</a></li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </div>
{% endblock %}
{% block content %}
    {% for message in get_flashed_messages() %}
        <div class="alert alert-warning">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            {{ message }}
        </div>
    {% endfor %}
    <div class="col-sm-11">
        {% block body_content %}{% endblock %}
    </div>
{% endblock %}
</body>
</html>
